#pragma once

#include "NodeDefs.h"
#include "Parser.h"

template<class Node, class Factory = NodeFactory<Node> >
class ParseBenchmark
{
    Factory m_factory;
    std::string m_sInputString;
    
public:
    ParseBenchmark(const std::string & sInputString, const Factory & factory = Factory())
        : m_factory(factory)
        , m_sInputString(sInputString)
    {
    }

    std::string getBenchmarkName() const
    {
        return std::string("Parsing using ") + m_factory.getFactoryName();
    }
    
    void process() const
    {
        delete parse<Node>(m_sInputString, m_factory);
    }
};
